package com.IoLiu;

import java.io.*;

public class ReaderWrite {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw=new OutputStreamWriter(new
                FileOutputStream("D:\\下载\\file\\file1\\字符流编码.txt",true),"GBK");
        osw.write("中国");
        osw.close();
        InputStreamReader isr=new InputStreamReader(new
                FileInputStream("D:\\下载\\file\\file1\\字符流编码.txt"));
        byte[] bys=new byte[1024];
        int len;
        while(-1 != (len = isr.read())){
            System.out.println((char)len);
        }

    }
}
